﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlBaoCaoTangTruongQuy.ascx.cs" Inherits="UserControl_ControlBaoCaoTangTruongQuy" %>


<%@ Register assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>

<%@ Register assembly="DevExpress.Web.ASPxPivotGrid.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPivotGrid" tagprefix="dxwpg" %>
<%@ Register assembly="DevExpress.Web.ASPxPivotGrid.v9.2.Export, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.XtraPivotGrid.Web" tagprefix="dxpgw" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dxpc" %>



<script type="text/javascript">
    function pageLoad() {


        $("#<%= imgBtnAdd.ClientID %>").click(function () {

            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });

        });
        $("#<%= imgBtnSave.ClientID %>").click(function () {
            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });
            setTimeout($.unblockUI, 5000);
        });
        $("#<%= imgBtnPivot.ClientID %>").click(function () {
            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });
            setTimeout($.unblockUI, 5000);
        });
        $("#<%= imgBtnClearFilter.ClientID %>").click(function () {

            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });

        });



        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            $.unblockUI();
        }

    }

</script>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="imgBtnSave" />
<asp:PostBackTrigger ControlID="imgBtnPivot" />
</Triggers>
    <ContentTemplate>
    
                <div class="direct_container_right_titletop direct_colleft">
                    Báo cáo mức độ tăng trưởng từng quý
                </div>
                
                <!-- Button chuc nang-->
                <div class="direct_menu_report_page direct_colleft">
                
                    Chọn quý:
                  
                    <asp:DropDownList ID="DropQuy" runat="server" >
                    </asp:DropDownList>
                   
                    So sánh với quý:
                  
                    <asp:DropDownList ID="DropCompare" runat="server">
                    </asp:DropDownList>
                    <asp:ImageButton ID="imgBtnAdd" CausesValidation="false" onclick="imgBtnAdd_Click" ToolTip="Lấy dữ liệu"  ImageUrl="~/Images/Document.png" Width="32px" Height="32px" runat="server" />
                    <asp:ImageButton ID="imgBtnSave" onclick="imgBtnSave_Click" CausesValidation="false" ToolTip="Xuất ra file excel dạng thường" ImageUrl="~/Images/download.png" Width="32px" Height="32px" runat="server" />
                    <asp:ImageButton ID="imgBtnPivot" onclick="imgBtnPivot_Click" CausesValidation="false" ToolTip="Xuất ra pivot excel" ImageUrl="~/Images/Rename.png" Width="32px" Height="32px" runat="server" />
                  
                    <asp:ImageButton ID="imgBtnClearFilter" runat="server" CausesValidation="false" 
                        Height="32px" ImageUrl="~/Images/Refresh.png" onclick="imgBtnClearFilter_Click" 
                        ToolTip="Clear all filters" Width="32px" />
                  
                </div>
                <!-- End Button chuc nang-->
                <div class="clear"></div>
                 <hr />

                
                   <table>
                   
                    <tr>
                    <td>
                      <dxpgw:ASPxPivotGridExporter ID="ASPxPivotGridExporter1" ASPxPivotGridID="ASPxPivotGrid1"  runat="server" Width="100%">
        </dxpgw:ASPxPivotGridExporter>
        <dxwpg:ASPxPivotGrid ID="ASPxPivotGrid1" CustomizationFieldsVisible="True"     OnCustomCellDisplayText="ASPxPivotGrid1_CustomCellDisplayText" runat="server">
                 <Fields>
               
                <dxwpg:PivotGridField ID="pTDV" Area="FilterArea"  AreaIndex="0" 
                         Caption="Nhân viên bán hàng" FieldName="NVBH" Visible="False">
                </dxwpg:PivotGridField>
                
                <dxwpg:PivotGridField ID="pTinhThanh" Area="FilterArea"  AreaIndex="0" 
                         Caption="Tỉnh thành" FieldName="TinhThanh" Visible="False">
                </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="pQuanHuyen" Area="FilterArea"  AreaIndex="1" 
                         Caption="Quận huyện" FieldName="QuanHuyen" Visible="False">
                </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="pChanel" Area="FilterArea"  AreaIndex="1" 
                         Caption="Channel" FieldName="Channel" Visible="False">
                </dxwpg:PivotGridField>
               
                
                <dxwpg:PivotGridField ID="pSubChanel" Area="FilterArea"  AreaIndex="1" 
                         Caption="SubChannel" FieldName="SubChannel" Visible="False">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="pCustomer" Area="FilterArea"  AreaIndex="1" 
                         Caption="Khách hàng" FieldName="Customer" Visible="False">
                </dxwpg:PivotGridField>

                 <dxwpg:PivotGridField ID="pGAM" Area="RowArea"  AreaIndex="0" 
                         Caption="GAM" FieldName="GAM" Visible="False">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="pGroupHang" Area="RowArea"  AreaIndex="0" 
                         Caption="Group" FieldName="GroupHang" Visible="False">
                </dxwpg:PivotGridField>
               

             
                 
                 <dxwpg:PivotGridField ID="pMaHangTheoNPP"  AreaIndex="0" 
                         Caption="Tên hàng theo NPP" FieldName="MaHangTheoNPP" Visible="False">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="pMaHangTheoFimex" Area="RowArea"  AreaIndex="1" 
                         Caption="Tên hàng theo Fimex" FieldName="MaHangTheoFimex">
                </dxwpg:PivotGridField>

                     <dxwpg:PivotGridField ID="pSelQty" Area="DataArea" AreaIndex="2" 
                         Caption="D.Số Số lượng" CellFormat-FormatString="{0:###,###.###}" 
                         CellFormat-FormatType="Numeric" FieldName="selQty">
                     </dxwpg:PivotGridField>
                     <dxwpg:PivotGridField ID="pSelAmt" Area="DataArea" AreaIndex="3" 
                         Caption="D.Số Tiền" CellFormat-FormatString="{0:###,###.###}" 
                         CellFormat-FormatType="Numeric" FieldName="selAmt">
                     </dxwpg:PivotGridField>
                     <dxwpg:PivotGridField ID="pCmpQty" Area="DataArea" AreaIndex="0" 
                         Caption="So sánh số lượng" CellFormat-FormatString="{0:###,###.###}" 
                         CellFormat-FormatType="Numeric" FieldName="cmpQty">
                     </dxwpg:PivotGridField>
                     <dxwpg:PivotGridField ID="pCmpAmt" Area="DataArea" AreaIndex="1" 
                         Caption="So sánh tiền" CellFormat-FormatString="{0:###,###.###}" 
                         CellFormat-FormatType="Numeric" FieldName="cmpAmt">
                     </dxwpg:PivotGridField>

                     <dxwpg:PivotGridField ID="fTTSL" Area="DataArea" AreaIndex="4" 
                         Caption="TTrưởng SLượng">
                     </dxwpg:PivotGridField>

                     <dxwpg:PivotGridField ID="fTTDS" Area="DataArea" AreaIndex="5" 
                         Caption="TTrưởng DSố">
                     </dxwpg:PivotGridField>

                     <dxwpg:PivotGridField ID="fGrowRate" Area="DataArea" AreaIndex="6" 
                         Caption="%TTrưởng SLượng">
                     </dxwpg:PivotGridField>

                     <dxwpg:PivotGridField ID="fGrowAmt" Area="DataArea" AreaIndex="7" 
                         Caption="% TTrưởng DSố">
                     </dxwpg:PivotGridField>
                     
                     <dxwpg:PivotGridField ID="fTTDSL" Area="DataArea" AreaIndex="8" 
                         Caption="TTrưởng do SLượng">
                     </dxwpg:PivotGridField>

                     <dxwpg:PivotGridField ID="fTTDG" Area="DataArea" AreaIndex="9" 
                         Caption="TTrưởng do Giá">
                     </dxwpg:PivotGridField>
                     <dxwpg:PivotGridField ID="fieldSiteName" Area="RowArea" AreaIndex="0" 
                         Caption="Nhà phân phối" FieldName="SiteName">
                     </dxwpg:PivotGridField>
                     <dxwpg:PivotGridField ID="PivotGridField1" Area="FilterArea" AreaIndex="0"  Visible="False"
                         Caption="Vùng" FieldName="LAND">
                     </dxwpg:PivotGridField>

                </Fields>
                 <OptionsView ShowColumnHeaders="False" ShowDataHeaders="False" />
                <OptionsPager Visible="False">
               </OptionsPager>
        </dxwpg:ASPxPivotGrid>
                    </td>
                    </tr>
                 </table>
                              
           <dxpc:ASPxPopupControl ID="MessageBox" PopupHorizontalAlign="WindowCenter"  PopupVerticalAlign="WindowCenter" Font-Bold="true" HeaderText="DRM-S" runat="server" Height="91px" 
        Width="601px">
        <ContentCollection>
<dxpc:PopupControlContentControl ID="PopupControlContentControl1" runat="server" SupportsDisabledAttribute="True"></dxpc:PopupControlContentControl>
</ContentCollection>
    </dxpc:ASPxPopupControl>  
    </ContentTemplate>
</asp:UpdatePanel>